﻿
using System.ComponentModel.DataAnnotations;

namespace AnalysisApp.Web.Models
{
    public class MDXDesignerSettingModel
    {

        private int m_SubsetCount = 0;

        /// <summary>
        /// Количество отображаемых кортежей на оси (для SubSet)
        /// </summary>

        [Display(Name = "The maximum number of tuples to be returned")]
        public int SubsetCount
        {
            get { return m_SubsetCount; }
            set { m_SubsetCount = value; }
        }

        private bool m_UseVisualTotals = true;

        /// <summary>
        /// Использовать динамически формируемые визуальные итоги 
        /// </summary>
        [Display(Name = "Use Viusal Totals for Heirachy")]
        public bool UseVisualTotals
        {
            get { return m_UseVisualTotals; }
            set { m_UseVisualTotals = value; }
        }

        private bool m_GenerateCustomCalculated = true;

        /// <summary>
        /// Создавать пользовательские вычисления для уровня
        /// </summary>
        [Display(Name = "Generate custom calculations for Level")]
        public bool GenerateCustomCalculated
        {
            get { return m_GenerateCustomCalculated; }
            set { m_GenerateCustomCalculated = value; }
        }

        private bool m_HideEmptyColumns = true;

        /// <summary>
        /// Спятать пустые колонки
        /// </summary>
        [Display(Name = "Hide items with no data in there columns")]
        public bool HideEmptyColumns
        {
            get { return m_HideEmptyColumns; }
            set { m_HideEmptyColumns = value; }
        }

        private bool m_HideEmptyRows = true;

        /// <summary>
        /// Спятать пустые строки
        /// </summary>
        [Display(Name = "Hide items with no data in there rows")]
        public bool HideEmptyRows
        {
            get { return m_HideEmptyRows; }
            set { m_HideEmptyRows = value; }
        }

        private bool m_IncludeAllMembers = false;

        /// <summary>
        /// Включать все вычисляемые элементы иерархии или уровня
        /// </summary>
        [Display(Name = "Include all calculated members in heirarchy or level")]
        public bool IncludeAllMembers
        {
            get { return m_IncludeAllMembers; }
            set { m_IncludeAllMembers = value; }
        }

        private bool m_LoadQueryState = true;

        /// <summary>
        /// Загрузить сохраненное состояние MDX запроса
        /// </summary>
        [Display(Name = "Load the saved state of MDX query")]
        public bool LoadQueryState
        {
            get { return m_LoadQueryState; }
            set { m_LoadQueryState = value; }
        }

        private bool m_IsImportMDXQuery = true;

        /// <summary>
        /// Импортировать MDX запрос
        /// </summary>
         [ScaffoldColumn(false)]
        public bool IsImportMDXQuery
        {
            get { return m_IsImportMDXQuery; }
            set { m_IsImportMDXQuery = value; }
        }

        /// <summary>
        /// Класс обертка для параметров настройки MDX дизайнера
        /// </summary>
        public MDXDesignerSettingModel()
        {
            this.SubsetCount = 0;
            this.UseVisualTotals = true;
            this.GenerateCustomCalculated = false;
            this.HideEmptyColumns = true;
            this.HideEmptyRows = true;
            this.IncludeAllMembers = false;
            this.LoadQueryState = false;
            this.IsImportMDXQuery = false;
        }
    }
}